<?php
namespace app\lib;

use yii;

trait Redis 
{
    private static $instance;

    public function getInstance()
    {
        if (!self::$instance)
        {
        	$redis = new \Redis();
        	$redis -> pconnect("127.0.0.1",6379);
            self::$instance = $redis;
        }

        return self::$instance;
    }
}
